package com.lambkit.module.upms.shiro;

import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;

public class UpmsHashedCredentialsMatcher extends HashedCredentialsMatcher {
    public UpmsHashedCredentialsMatcher() {
        super();
    }

    public UpmsHashedCredentialsMatcher(String hashAlgorithmName) {
        super(hashAlgorithmName);
    }

    @Override
    public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) {
        UpmsUsernamePasswordToken talkUserNameToken = (UpmsUsernamePasswordToken)token;
        if(talkUserNameToken.getLoginType()==99) {
            // 免密码登录
            return true;
        }
        return super.doCredentialsMatch(token, info);
    }
}
